package com.aos.erp.message.model.vo;

import com.aos.erp.message.enums.PushStatus;
import com.aos.erp.message.enums.PushType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
@ApiModel("消息记录查询参数")
public class MRConditionVo implements Serializable {
    @ApiModelProperty(hidden = true, value = "每页查询数量", dataType = "Integer")
    private int pageSize = 20;
    @ApiModelProperty(hidden = true, value = "当前页码", dataType = "Integer")
    private int pageIndex = 1;
    @ApiModelProperty(hidden = true, value = "推送内容", dataType = "String")
    private String mrContent = "";
    @ApiModelProperty(hidden = true, value = "推送方式(app:APP；wx_public:微信公众号；wx_applet:微信小程序；sms_timely:及时短信)")
    private PushType pushType = null;
    @ApiModelProperty(hidden = true, value = "推送方式值")
    private int pushTypeValue;
    @ApiModelProperty(hidden = true, value = "推送状态：push_no为未发送；push_yes为已发送；push_stop为暂停发送")
    private PushStatus pushStatus = null;   // 推送状态
    @ApiModelProperty(hidden = true, value = "推送状态值")
    private int pushStatusValue;
    @ApiModelProperty(hidden = true, value = "范围开始时间")
    private String fromTime="";
    @ApiModelProperty(hidden = true, value = "范围截止时间")
    private String toTime="";
    @ApiModelProperty(hidden = true, value = "驾校ID(驾校查询可用模板时传入)")
    private long driverSchoolId = 0;      // 驾校ID

    public int getPushTypeValue() {
        return (int)pushType.getValue();
    }
    public int getPushStatusValue() {
        return (int)pushStatus.getValue();
    }

    public String getFromTime() {
        if(fromTime.length() > 0 && fromTime.length() == 10) {
            fromTime = fromTime + " 00:00:00";
        }
        return fromTime;
    }

    public String getToTime() {
        if(toTime.length() > 0 && toTime.length() == 10) {
            toTime = toTime + " 23:59:59";
        }
        return toTime;
    }
}
